<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/5/24
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>房屋信息展示系统</title>
</head>
<body>
    <table border="1px red solid" cellspacing="0" cellpadding="0">
        <th>房屋信息查询</th>
        <tr><td colspan="5"><a onclick="findType()">发布房源</a></td></tr>
        <tr>
            <td>序号</td>
            <td>描述</td>
            <td>户型</td>
            <td>租金</td>
            <td>发布时间</td>
        </tr>
        <c:forEach var="house" items="${pageInfo.list}">
            <tr>
                <td>${house.houseId}</td>
                <td>${house.houseDesc}</td>
                <td>${house.typeName}</td>
                <td>${house.monthlyRent}</td>
                <td>${house.publishDate}</td>
            </tr>
        </c:forEach>
    </table>

    <form action="../main2/findAll">
        <input type="hidden" name="pageIndex" value="1" />
        <div class="row">
            <div class="col-sm-5">
                <div class="dataTables_info" id="datatable-responsive_info"
                     role="status" aria-live="polite">共${pageInfo.total}条记录
                    ${pageInfo.pageNum}/${pageInfo.pages}页</div>
            </div>
            <div class="col-sm-7">
                <div class="dataTables_paginate paging_simple_numbers"
                     id="datatable-responsive_paginate">
                    <ul class="pagination">
                        <c:if test="${pageInfo.hasPreviousPage}">
                            <li class="paginate_button previous"><a
                                    href="javascript:page_nav(document.forms[0],1);"
                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                    tabindex="0">首页</a>
                            </li>
                            <li class="paginate_button "><a
                                    href="javascript:page_nav(document.forms[0],${pageInfo.prePage});"
                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                    tabindex="0">上一页</a>
                            </li>
                        </c:if>
                        <c:if test="${pageInfo.hasNextPage}">
                            <li class="paginate_button "><a
                                    href="javascript:page_nav(document.forms[0],${pageInfo.nextPage});"
                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                    tabindex="0">下一页</a>
                            </li>
                            <li class="paginate_button next"><a
                                    href="javascript:page_nav(document.forms[0],${pageInfo.lastPage});"
                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                    tabindex="0">最后一页</a>
                            </li>
                        </c:if>
                    </ul>
                </div>
            </div>
        </div>
    </form>





</body>
</html>
<script src="${pageContext.request.contextPath }/statics/js/rollpage.js"></script>

<script>
    function findType(){
        window.location.href= "../main2/findType";
    }
</script>